From 120b001b73357ed617411cbd38c732c07199539d Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 21 Sep 2004 02:14:46 +0000 Subject: [PATCH] Tear up static 'comport' after a CloseFile on it. --- gpsbabel/jeeps/gpsserial.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gpsbabel/jeeps/gpsserial.c b/gpsbabel/jeeps/gpsserial.c index 31345fe3a..31d99860c 100644 --- a/gpsbabel/jeeps/gpsserial.c +++ b/gpsbabel/jeeps/gpsserial.c @@ -123,6 +123,7 @@ int32 GPS_Serial_On(const char *port, int32 *fd) if (!SetCommState (comport, &tio)) { GPS_Serial_Error("SetCommState"); CloseHandle(comport); + comport = INVALID_HANDLE_VALUE; gps_errno = SERIAL_ERROR; return 0; } @@ -142,6 +143,7 @@ int32 GPS_Serial_On(const char *port, int32 *fd) if (!SetCommTimeouts (comport, &timeout)) { GPS_Serial_Error("SetCommTimeouts"); CloseHandle (comport); + comport = INVALID_HANDLE_VALUE; gps_errno = SERIAL_ERROR; return 0; } @@ -155,6 +157,7 @@ int32 GPS_Serial_Off(const char *port, int32 fd) gusb_close(port); } else { CloseHandle(comport); + comport = INVALID_HANDLE_VALUE; } return 1; } -- 2.30.2